package cn.hznc.handle;

import cn.hznc.domain.response.ResponseBody;
import cn.hznc.exception.UserException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author：Administrator
 * @Date：2023/11/13 14:04
 */
@RestControllerAdvice
public class GlobalExceptionHandler{

    @ExceptionHandler(value ={UserException.class})
    public ResponseBody handleUserException(Exception ex){
        return ResponseBody.error("303" , "请先登录");
    }

//    @ExceptionHandler(value ={Exception.class})
//    public ResponseBody handleException(Exception ex){
//        return ResponseBody.error("505" , "系统繁忙，请稍后再试");
//    }

}
